package com.acxy.b2b2c.entity;


import com.acxy.ants.common.kit.DateKit;
import com.acxy.ants.core.plugin.entity.Column;
import com.acxy.ants.core.plugin.entity.Id;
import com.acxy.ants.core.plugin.entity.Model;
import com.acxy.ants.core.plugin.entity.Table;
import com.acxy.ants.resful.annotation.Entity;
import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
* (goods)
*
* @author MrShun
* @version 1.0.0 2017-10-09
*/
@Entity
@Table(name = "goods")
public class Goods extends Model implements Serializable {

    /** 商品ID */
    @Id
    @Column(name = "id")
    private Long id;

    /** 商品的唯一货号 */
    @Column(name = "goods_sn")
    private String goodsSn;

    /** 商品名称 */
    @Column(name = "goods_name")
    private String goodsName;

    /** 商品分类 */
    @Column(name = "cat_id")
    private Long catId;

    /**  */
    @Column(name = "be_mall")
    private String beMall;

    /** 商品名称显示样式 */
    @Column(name = "style")
    private String style;

    /** 商品点击次数 */
    @Column(name = "hits")
    private Integer hits;

    /** 库存数 */
    @Column(name = "goods_num")
    private Integer goodsNum;

    /** 商品单位 */
    @Column(name = "goods_weight")
    private String goodsWeight;

    /** 市场售价 */
    @Column(name = "market_price")
    private BigDecimal marketPrice;

    /** 本店售价 */
    @Column(name = "shop_price")
    private BigDecimal shopPrice;

    /** 促销价 */
    @Column(name = "promote_price")
    private BigDecimal promotePrice;

    /** 促销价开始时间 */
    @JSONField(format = "yyyy-MM-dd HH:mm")
    @Column(name = "promote_start_date")
    private java.util.Date promoteStartDate;

    /**  */
    @JSONField(format = "yyyy-MM-dd HH:mm")
    @Column(name = "promote_end_date")
    private java.util.Date promoteEndDate;

    /** 预设商品报警数 */
    @Column(name = "warn_num")
    private Integer warnNum;

    /** 收录关键词 */
    @Column(name = "keywords")
    private String keywords;

    /** 商品简单描述 */
    @Column(name = "goods_brief")
    private String goodsBrief;

    /** 商品详情 */
    @Column(name = "goods_desc")
    private String goodsDesc;

    /** 商品封面图 */
    @Column(name = "goods_thumb")
    private String goodsThumb;

    /** 多张属性图片 */
    @Column(name = "goods_imgs")
    private String goodsImgs;

    /** 是否显示该商品；0，否；1，是 */
    @Column(name = "is_show")
    private Integer isShow;

    /** 商品排序 */
    @Column(name = "sort_order")
    private Integer sortOrder;

    /** 商品类型；0，默认；1，最新； 2，推荐；3、热门；4、促销 */
    @Column(name = "goods_type")
    private Integer goodsType;

    /** 商品添加时间 */
    @JSONField(format = "yyyy-MM-dd HH:mm")
    @Column(name = "create_time")
    private java.util.Date createTime;

    /** 最后更新时间 */
    @Column(name = "last_update")
    private java.util.Date lastUpdate;

    //时间提示
    private String timeTips;

	public Goods(){}

    public Goods(Long id){
        this.id = id;
    }

    public Long getId(){
        return id;
    }

    public void setId(Long id){
        this.id = id;
    }


    public String getGoodsSn(){
        return goodsSn;
    }

    public void setGoodsSn(String goodsSn){
        this.goodsSn = goodsSn;
    }


    public String getGoodsName(){
        return goodsName;
    }

    public void setGoodsName(String goodsName){
        this.goodsName = goodsName;
    }


    public Long getCatId(){
        return catId;
    }

    public void setCatId(Long catId){
        this.catId = catId;
    }


    public String getBeMall(){
        return beMall;
    }

    public void setBeMall(String beMall){
        this.beMall = beMall;
    }


    public String getStyle(){
        return style;
    }

    public void setStyle(String style){
        this.style = style;
    }


    public Integer getHits(){
        return hits;
    }

    public void setHits(Integer hits){
        this.hits = hits;
    }


    public Integer getGoodsNum(){
        return goodsNum;
    }

    public void setGoodsNum(Integer goodsNum){
        this.goodsNum = goodsNum;
    }


    public String getGoodsWeight(){
        return goodsWeight;
    }

    public void setGoodsWeight(String goodsWeight){
        this.goodsWeight = goodsWeight;
    }


    public BigDecimal getMarketPrice(){
        return marketPrice;
    }

    public void setMarketPrice(BigDecimal marketPrice){
        this.marketPrice = marketPrice.setScale(2, BigDecimal.ROUND_DOWN);
    }


    public BigDecimal getShopPrice(){
        return shopPrice;
    }

    public void setShopPrice(BigDecimal shopPrice){
        this.shopPrice = shopPrice.setScale(2, BigDecimal.ROUND_DOWN);
    }


    public BigDecimal getPromotePrice(){
        return promotePrice;
    }

    public void setPromotePrice(BigDecimal promotePrice){
        this.promotePrice = shopPrice.setScale(2, BigDecimal.ROUND_DOWN);
    }


    public java.util.Date getPromoteStartDate(){
        return promoteStartDate;
    }

    public void setPromoteStartDate(java.util.Date promoteStartDate){
        this.promoteStartDate = promoteStartDate;
    }


    public java.util.Date getPromoteEndDate(){
        return promoteEndDate;
    }

    public void setPromoteEndDate(java.util.Date promoteEndDate){
        this.promoteEndDate = promoteEndDate;
    }


    public Integer getWarnNum(){
        return warnNum;
    }

    public void setWarnNum(Integer warnNum){
        this.warnNum = warnNum;
    }


    public String getKeywords(){
        return keywords;
    }

    public void setKeywords(String keywords){
        this.keywords = keywords;
    }


    public String getGoodsBrief(){
        return goodsBrief;
    }

    public void setGoodsBrief(String goodsBrief){
        this.goodsBrief = goodsBrief;
    }


    public String getGoodsDesc(){
        return goodsDesc;
    }

    public void setGoodsDesc(String goodsDesc){
        this.goodsDesc = goodsDesc;
    }


    public String getGoodsThumb(){
        return goodsThumb;
    }

    public void setGoodsThumb(String goodsThumb){
        this.goodsThumb = goodsThumb;
    }


    public String getGoodsImgs(){
        return goodsImgs;
    }

    public void setGoodsImgs(String goodsImgs){
        this.goodsImgs = goodsImgs;
    }


    public Integer getIsShow(){
        return isShow;
    }

    public void setIsShow(Integer isShow){
        this.isShow = isShow;
    }

    public java.util.Date getCreateTime(){
        return createTime;
    }

    public void setCreateTime(java.util.Date createTime){
        this.createTime = createTime;
    }


    public Integer getSortOrder(){
        return sortOrder;
    }

    public void setSortOrder(Integer sortOrder){
        this.sortOrder = sortOrder;
    }

    public Integer getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(Integer goodsType) {
        this.goodsType = goodsType;
    }

    public java.util.Date getLastUpdate(){
        return lastUpdate;
    }

    public void setLastUpdate(java.util.Date lastUpdate){
        this.lastUpdate = lastUpdate;
    }

    public String getTimeTips() {
        return (promoteStartDate == null && promoteEndDate == null)?null: DateKit.toMsTips(promoteStartDate, promoteEndDate);
    }

    public void setTimeTips(String timeTips) {
        this.timeTips = timeTips;
    }

}